package com.ts.api.module.api.entity.bo;

import lombok.Data;

/**
 *  API验证流程业务实体
 *
 *  @author Pan
 */
@Data
public class ApiRequiredFlowBO {

    /** 手机号MD5 */
    private String phoneMd5;
    /** API客户端id */
    private String apiClientId;
    /** 渠道id */
    private Long loanChannelId;
    /** 请求id */
    private String reqId;
    /** 计划主体id */
    private Long productPlanId;

    /**
     *  根据apiClientId创建业务实体
     *
     *  @param  phoneMd5     手机号md5
     *  @param  apiClientId  api客户端id
     *  @return ApiRequiredFlowBO
     */
    public static ApiRequiredFlowBO createByApiClientId(String phoneMd5, String apiClientId) {
        ApiRequiredFlowBO apiRequiredFlowBO = new ApiRequiredFlowBO();
        apiRequiredFlowBO.setPhoneMd5(phoneMd5);
        apiRequiredFlowBO.setApiClientId(apiClientId);
        return apiRequiredFlowBO;
    }

    /**
     *  根据loanChannelId创建业务实体
     *
     *  @param  phoneMd5        手机号md5
     *  @param  loanChannelId   渠道id
     *  @return ApiRequiredFlowBO
     */
    public static ApiRequiredFlowBO createByChannelId(String phoneMd5, Long loanChannelId) {
        ApiRequiredFlowBO apiRequiredFlowBO = new ApiRequiredFlowBO();
        apiRequiredFlowBO.setPhoneMd5(phoneMd5);
        apiRequiredFlowBO.setLoanChannelId(loanChannelId);
        return apiRequiredFlowBO;
    }

    /**
     *  掩码模式流程
     *
     *  @param  apiClientId         api客户端id
     *  @param  productPlanId       计划id
     *  @param  dataExchangeReqId   撞库请求id
     *  @return ApiRequiredFlowBO
     */
    public static ApiRequiredFlowBO createPhoneMaskFlow(String apiClientId, Long productPlanId, String dataExchangeReqId) {
        ApiRequiredFlowBO apiRequiredFlowBO = new ApiRequiredFlowBO();
        apiRequiredFlowBO.setApiClientId(apiClientId);
        apiRequiredFlowBO.setProductPlanId(productPlanId);
        apiRequiredFlowBO.setReqId(dataExchangeReqId);
        return apiRequiredFlowBO;
    }
}
